package com.ziyun.erp.modules.production.operate.test;

import com.ziyun.erp.modules.production.entity.ErpOrderProductionEntity;
import lombok.Getter;
import lombok.Setter;

/**
 * @author guizhao
 * @Title: 生产订单环境类
 * @ProjectName ziyun-service-erp
 * @date 2018-09-07 11:32
 */
@Getter
@Setter
public class ProductionContext {
    /**
     * 状态
     */
    private ProductionState productionState;

    /**
     * 生产单
     */
    private ErpOrderProductionEntity erpOrderProductionEntity;

    public ProductionContext() {
    }

    public ProductionContext(ProductionState productionState,ErpOrderProductionEntity erpOrderProductionEntity) {
        this.productionState = productionState;
        this.erpOrderProductionEntity = erpOrderProductionEntity;
    }

    /**
     * 前进到下一个状态
     */
    public void forward(){
        productionState.forward(this);
    }

    /**
     * 返回上一个状态
     */
    public void rollback(){
        productionState.forward(this);
    }
}
